package cn.bone.lambda.demo01;

import io.vertx.core.impl.ContextTask;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;

/**
 * Created by MD-01 on 2017/2/22.
 */
public class Demo02 {

    public static void main(String[] args) {

        Set<String> names = new HashSet<>();
        names.add("a");
        names.add("b");
        names.add("c");

        Predicate<String> isKnown = names::contains;

        boolean result = isKnown.test("11");
        System.out.println(result);

        List<String> list = Arrays.asList("a", "b", "d");
        list.forEach(
                System.out::println
        );

        Callable<Path> c = () -> {
            Path p = Paths.get("/d");
            System.out.println(p.getFileSystem());
            return p;
        };
        ContextTask call = c::call;
        try {
            call.run();
        } catch (Exception e) {
            e.printStackTrace();
        }

        BiFunction<String, Locale, String> stringLocaleStringBiFunction = String::toUpperCase;

        Function<String,String> upperfier = String::toUpperCase;
        String abc = upperfier.apply("abc");
        System.out.println(abc);
    }
}
